/**
 * Created by qunxing.du on 2016/7/18.
 * Copyright 2016 汉威.智慧环保事业部 Limited.
 * All rights reserved.
 */
package com.hw.one.collect.gdyc.data;

import com.hw.one.collect.data.DataService;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 广德job
 */
@Service
public class GdDataService extends DataService{
    protected static final String FACTORS = "HUM=HUMI,TEMP=TEMP,PRE=PRE,WD=WINDD,WS=WINDS,NOISE=NOISE,PM25=PM25,PM10=PM10,TSP=TSP";
    protected static final String DEVICES = "DQJC102=301000001";
    protected static final String VAL_SEPARATOR =":|:";//值分隔符
    protected static final String FACTOR_SEPARATOR ="#|#";//因子分隔符

    @Resource
    protected MongoTemplate dqjcMongoTemplate;

    /**
     * 获取集合名称
     * @return
     */
    protected String getCollection(){
        String collectionPrefix = "cloud_dqjc_";
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
        String todayDate = sdf.format(new Date());
        return collectionPrefix+todayDate;
    }

}
